<!DOCTYPE html>
{include file="public/link" /}
<div class="layui-card">
    <div class="layui-card-header">
        <!-- 数据表按钮 -->
        <div class="kb-btn-container">
            <button type="button" kb-event="create" class="layui-btn layui-btn-sm">添加表</button>
            <button type="button" kb-event="delete-all" data-id="[]"
                class="layui-btn layui-btn-sm layui-bg-red">删除表</button>
        </div>
    </div>
    <div class="layui-card-body layui-form">
        <table class="layui-table">
            <colgroup>
                <col width="50">
                <col width="150">
                <col>
                <col>
                <col>
                <col width="120">
            </colgroup>
            <thead>
                <tr>
                    <th>
                        <input type="checkbox" lay-filter="checkAll">
                    </th>
                    <th>表名</th>
                    <th>备注</th>
                    <th>记录</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="kb-table-body"></tbody>
        </table>
    </div>
</div>

{include file="public/script" /}
<script>
    layui.use(["common", "mysql"], () => {
        let common = layui.common
        let mysql = layui.mysql

        mysql.render({
            SELECT_API: "{:url('table/query')}", // 查询
            UPDATE_API: "{:url('table/update')}", // 更新
            CREATE_API: "{:url('table/create')}", // 创建
            DELETE_API: "{:url('table/delete')}", // 删除
            BUILD_API: "{:url('table/build')}", // 生成
            CREATE_FIELD_API: "{:url('table/create_field')}", // 创建字段
            UPDATE_FIELD_API: "{:url('table/update_field')}", // 更新字段
            DELETE_FIELD_API: "{:url('table/delete_field')}", // 删除字段
        })
    })
</script>